Can Chrome's built-in JavaScript console display colors?
google chrome內建的js console顯示顏色可以改變嗎?
I want errors in red, warnings in orange and console.log's in green. Is that possible?
有可能說例如我想要讓錯誤變紅色警告變橘色,剩下的變綠色嗎?
In Chrome & Firefox (+31) you can add CSS in console.log messages:
在Chrome & Firefox (+31)你是可以對console.log本身加入css信息的,例如:
console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
The same can be applied for adding multiple CSS to same command.
同樣地,你可以加入多個CSS指令
另一個直接從本地修改的方式:把
.console-error-level .console-message-text{
color: red;
}
.console-warning-level .console-message-text {
color: orange;
}
.console-log-level .console-message-text {
color:green;
}
置入c:\Documents and Settings<User Name>\Local Settings\Application Data\Google\Chrome\User Data\Default\User StyleSheets\Custom.css